﻿using CoffeeShop.DAO;
using CoffeeShop.Models.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CoffeeShop.BIZ
{
    public class UserBiz
    {
        private UserDao _userDao = new UserDao();

         /// <summary>
        /// Add new a user into DB
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public bool AddNewUser(User user)
        {
            return _userDao.AddNewUser(user);
        }

        /// <summary>
        /// Check UserName is duplicate or not
        /// </summary>
        /// <param name="userName"></param>
        /// <returns>True: Duplicate -- False: Not duplicate</returns>
        public bool IsDuplicateUserName(string userName)
        {
            return _userDao.IsDuplicateUserName(userName);
        }
    }
}